<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>插槽(slot)</title>  
    <script src="./vue.js"></script>
</head>
<body>
    <div id="root">
        <child>
            <h1 slot="header">头部</h1>
            <h2 slot="footer">尾部</h2>
        </child>
    </div>
    <script>

        Vue.component('child',{
            template:"<div><slot name='header'>这里是默认的头部</slot><div>content</div><slot name='footer'>这里是默认的尾部</slot></div>"
            },
        )
        var vm = new Vue({
            el:'#root',
            data:{
            },
            methods:{
                }
        })
    </script>
</body>
</html>